home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cedadds.arc
/
READ.ME
< prev
Wrap
Text File
|
1987-04-29
|
5KB
|
126 lines
February 16, 1987
PUSHD / POPD and new CD for MS-DOS
-----------------------------------
Introduction:
About a week ago, I received the Command EDitor CED (by J.C.Dunford).
For this program I wrote two additional utilities. They give you the
following new commands:
PUSHD saves current directory on a stack
POPD pop's back to a dir saved by PUSHD
(makes it current again)
CD works like the original, but also evaluates
the environement variable CDPATH
How do they work:
PUSHD/POPD
PUSHD saves the current directory on stack which may hold no more than
five entries.
With the command POPD you automatically change back to the next saved
directory.
CD
Basically, it works the same way as the COMMAND.COM's CD it replaces.
The current parameter is changed to the pathname given as the one and
only parameter. In case of an error, it also searches the directories
specified in the environement string CDPATH for that directory you'd
like to make the current one. This, of course, only happens if the
specified parameter doesn't start with '\' nor '/'. If all these
attempts to change the current directory fail, it's time for an error
message.
Usage:
One possible use for PUSHD/POPD is with sidekick. You can't use the
help file unless you start sidekick in the same directory. (Perhaps
there is another way. If so, I'm missing it. BTW, I don't use sk
often). The following isn't of much use for those of you who start
sidekick in the AUTOEXEC.BAT. All the others might try:
CED SYN sk pushd^cd \your-sk-directory^sk^popd
If you'd like to use sidekick, just type sk. This installs it and
leaves you in the directory you were in before.
Usage for the new CD should be obvious. Some hints for defining the
environement string CDPATH: It contains a list of the directories which
you want to be searched for the directory. Each one is separated by ';'
from the previous one. Don't terminate an entry with '\' or '/'. This
will lead to an error. If you'd like to include the root, just start
the string with ';' or include ';;' somewhere in the string. The
directories are searched in the order you list them in CDPATH. The
environement must be defined at the time you load this routine into
ram. Any changes after that time aren't reflected.
Configuration:
In the sources you can change some limits to your taste. For PUSHD/POPD
you'll find a definition for a constant called 'entries'. It specifies
the depth of the stack (the number of entries, the stack can hold). At
present, its value is set to five.
The new CD uses a constant called 'cdlength' which specifies the max.
length of the environement variable CDPATH. The default is 255. Any
characters exceeding that length are truncated.
As a parameter to the command NEWCD which installs the new CD command,
you can specify if CD without a parameter changes to the root or if it
prints the name of the current directory. Default is changing to the
root. If the loader detects a 'p'or a 'P'in one of the following
parameters, CD without a parameter prints the current directory. (Yes,
I am lazy.)
The names of the commands must be changed in the sources. You'll find
their definitions are at the end of the sources.
In case of an error:
I didn't test them very hard. This is especially true for the parameter
parsing routines. On my system, an IBM-PC/AT-compatible, I tested the
basic functions, and they seem to work.
If the two programs won't work on your system, please uninstall all
the resident software. This is one possible cause of malfunction since
PUSHD/POPD and CD reside in RAM, too.
At least on TSR is known to cause bad surprises: Ramkey by Quaid
Software Limited. Don't ask me what this one is good for. A friend,
who uses it, told me of its bad effect.
Limitations:
There is an additional limitation to these two programs (and to
extensions to COMMAND.COM using CED in general): You can't use them
in .BAT files. CED monitors the keyboard input and commands read from
.BAT files aren't evaluated that way. But you can use them in synonyms,
of course. The 'original' CD, the one defined by COMMAND.COM, still
works in batch-files. Though, you can't use the features brought to you
by the new CD.
Flames:
These are my first assembler programs since about one and half a year.
I didn't have an assembler handbook ready, too. So, if you find 'bad'
code (e.g. too much statements), feel free to patch them. It would be
nice if you dropped me a note on this subject.
Don't send me any flames concerning my programming style nor my
english writing. I think, very few of you would understand a word if I
wrote the doc and the comments in swiss german :-).
Public Domain:
I place these two programs in the public domain and you may make as
much copies as you like. You may distribute it for non commercial use
only and you have to include the sources.
Have a nice day,
...urs zurbuchen
PS: One nice feature of the new CD: You may use \ or / as directory
delimiter. But remember, this is only valid for CD.